package wzc.design_pattern.behaviour.command;

/**
 * @Author 那和不是个啥
 * @Date 2025/7/20
 * @Description
 */

public class LightOffCommand implements Command{
    private Light light;

    public LightOffCommand(Light light) {
        this.light = light;
    }

    @Override
    public void execute() {
        light.turnOff();
    }

    @Override
    public void undo() {
        light.turnOn();
    }
}
